widget: Update underallocation warning
authorBenjamin Otte <otte@redhat.com>
Thu, 28 Apr 2011 19:25:29 +0000 (21:25 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 28 Apr 2011 20:21:45 +0000 (22:21 +0200)
Also print the parent widget. As the parent's size_allocate
implementation is usually the culprit for this warning happening, it
makes sense to print it.

gtk/gtkwidget.c

index f45d4904119a8aee2e3d7b9ef6688c7ad103f13f..86e59d3df83101e122d03d00cde8b74224656912 100644 (file)
@@ -4817,8 +4817,9 @@ gtk_widget_size_allocate (GtkWidget       *widget,
     }
 
   if (min_width > real_allocation.width || min_height > real_allocation.height)
-    g_warning ("gtk_widget_size_allocate(): attempt to underallocate %s %p. "
+    g_warning ("gtk_widget_size_allocate(): attempt to underallocate %s%s %s %p. "
                "Allocation is %dx%d, but minimum required size is %dx%d.",
+               priv->parent ? G_OBJECT_TYPE_NAME (priv->parent) : "", priv->parent ? "'s child" : "toplevel",
                G_OBJECT_TYPE_NAME (widget), widget,
                real_allocation.width, real_allocation.height,
                min_width, min_height);